A. Quintomania | Codeforces Round 984 | Solution In Node.js |